import {IGoodsCateItem, IMallPageItem, ISupplierItem} from "@/api/modules/pointsMall";


interface IPointsMallState {
  mallConfig: IMallPageItem,
  goodsCateList: IGoodsCateItem[],
  supplierList: ISupplierItem[],
  goodsIds:string[]
}

export default {
  namespaced: true,
  state() {
    return {
      mallConfig: {}, // 当前操作的积分商城
      goodsCateList: [], // 商品分类选项列表
      supplierList: [], // 商品供应商选项列表
      goodsIds:[],//当前通知需要查询的商品id
    }
  },

  mutations: {
    updateMallConfig(state: IPointsMallState, payload: IMallPageItem) {
      state.mallConfig = payload
    },

    updateGoodsCateList(state: IPointsMallState, payload: IGoodsCateItem[]) {
      state.goodsCateList = payload
    },

    updateSupplierList(state: IPointsMallState, payload: ISupplierItem[]) {
      state.supplierList = payload
    },
    updateGoodsIds(state:IPointsMallState,payload:string[]){
      state.goodsIds=payload
    }
  }
}
